﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H


#include <QMainWindow>
#include <QPainter>
#include <QPen>
#include <QColor>
#include <QVector>
#include <QPaintEvent>
#include <QMouseEvent>
#include "item.h"

#define ROW 15          //棋盘总行数
#define COLUMN 15       //棋盘总列数
#define HIGH 50         //每个单元格的高度
#define WIDTH 50        //每个单元格的高度

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

protected:
virtual void paintEvent(QPaintEvent *event);
virtual void mousePressEvent(QMouseEvent *event);

private:

    void DrawChessBoard();
    void DrawChessPress();

private:
    Ui::MainWindow *ui;
    bool m_isBlack;
    QVector<item> m_vecItem;
};
#endif // MAINWINDOW_H
